﻿using System;
using Useful;
using Useful.GUI;
using Useful.MVP2;

namespace FileDuplicateRemover.Gui
{
    internal class MyPresenterImpl : IPresenterImpl
    {
        public void ShowWarring(string str)
        {
            MessageBoxHelper.ShowWarring(str);
        }

        public bool ShowQuestion(string str)
        {
            return MessageBoxHelper.ShowQuestion(str);
        }

        public void ShowAcessDenied(string str)
        {
            MessageBoxHelper.ShowWarring(str, "Нет прав");
        }

        public void HandleException(string msg, Exception ex)
        {
            MessageBoxHelper.ShowError(msg + "\r\n" + ex.Message);
        }

        public void ShowWaiting(object context, string message, GuiHelper.ProcessActionDelegate progress)
        {
            using (new HourGlassCursor())
            {
                progress();
            }
        }
    }
}
